local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());

--控制服务器显示文件夹ServerShowFoder，此文件夹，只对其他玩家进行同步物品

local IsClient = game:GetService("RunService"):IsClient();

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);

    self:AddProcess(function()
        self:InitServerShowFoder()
    end)

end;
function M.GetServerShowFolderName(self)
    return "ServerShow"..self.parent:GetUserId()
end
function M.InitServerShowFoder(self)

    if IsClient then
        --在客户端删掉子弹容器，避免同步到服务器的子弹
       local f= CommonOHOH:GetPath_Loop(self:GetServerShowFolderName(),workspace)
       f:Destroy()
    else
        --服务器创建子弹容器
        local bullet= Instance.new("Folder",workspace)
        bullet.Name=self:GetServerShowFolderName()
         self.ShowFoder=bullet
    end

end

-- 仅限服务器调用
function M.GetOtherPlayerShowFoder(self)
    return  self.ShowFoder
end


function M.dtor(self)
    if self.ShowFoder then
        self.ShowFoder:Destroy()
    end
	M.super.dtor(self);
end


return M

